package team.central.states;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

public class Gameplay extends BasicGameState {
	
	Image player;
	Image wall;
	
	private float x = 0;
	private float y  = 0;
	
	private int ID = 0;
	public Gameplay(int ID) {
		this.ID = ID;
	}
	
	@Override
	public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
		player = new Image("res/player.png");
		wall = new Image("res/wall.png");
		
	}

	@Override
	public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
		player.draw(x, y);
		wall.draw(0, 400);
		
	}

	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
		Input input = gc.getInput();
		
		if (input.isKeyDown(Input.KEY_W)) {
			y--;
		}
		if (input.isKeyDown(Input.KEY_S)) {
			y++;
		}
		if (input.isKeyDown(Input.KEY_D)) {
			x++;
		}
		if (input.isKeyDown(Input.KEY_A)) {
			x--;
		}
		
	}

	@Override
	public int getID() {
		return ID;
	}

}
